<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <title>亿人宝 - 余额充值</title>
    <meta content="" name="keywords"/>
    <meta content="" name="description"/>
    <link rel="stylesheet" th:href="@{/css/common.css}"/>
    <link rel="stylesheet" th:href="@{/css/user.css}" type="text/css"/>
    <link rel="stylesheet" th:href="@{/css/jquery.datetimepicker.css}" type="text/css"/>
    <script th:src="@{/script/jquery.min.js}" type="text/javascript"></script>
    <script th:src="@{/script/common.js}" type="text/javascript"></script>
    <script th:src="@{/script/user.js}" type="text/javascript"></script>
    <script th:src="@{/layui/layer/layer.js}" type="text/javascript"></script>
</head>
<body>
<div th:replace="common/public::head"></div>
<!--个人中心-->
<div class="wrapper wbgcolor">
    <div class="w1200 personal">
        <!--<div class="credit-ad"><img height="80" th:src="@{/images/clist1.jpg}" width="1000"></div>-->

        <div class="personal-left" id="personal-left">
            <ul>
                <li><span><a th:href="@{/per/index(option = 1)}"><i class="dot dot1"></i>账户总览</a></span></li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/cap/cap_List}">资金记录</a></span></li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/per/investlist(option = 1)}">投资记录</a></span>
                </li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/per/prolist}">回款计划</a></span></li>
                <li><span><a th:href="@{/per/thirdparty}"><i class="dot dot02"></i>开通第三方</a> </span></li>
                <li class="pleft-cur"><span><a th:href="@{/per/torecharge}"><i class="dot dot03"></i>充值</a></span></li>
                <li><span><a th:href="@{/per/towithdrawal}"><i class="dot dot04"></i>提现</a></span></li>
                <li style="position:relative;"><span> <a th:href="@{/per/toredenvelopes(state = 1)}"> <i class="dot dot06"></i> 我的红包 </a> </span></li>
                <li style="position:relative;"><span> <a th:href="@{/per/tomessages}"><i class="dot dot08"></i>系统信息 </a> </span></li>
                <li><span><a th:href="@{/setUser/toView}"><i class="dot dot09"></i>账户设置</a></span></li>
            </ul>
        </div>
        </label>
        <script>
            $(function () {
                //快捷支付切换面板
                $('.quick-tit').click(function () {

                    $(this).addClass('pay-cur');
                    $(this).siblings().removeClass('pay-cur');
                    $('.quick-main').show();
                    $('.online-main').hide();
                    $('.weixin-main').hide();
                    $(".pay-tipcon").hide();
                    $(".pay-tipcon2").show();

                });
                //网银支付切换面板
                $('.online-tit').click(function () {

                    $(this).addClass('pay-cur');
                    $(this).siblings().removeClass('pay-cur');
                    $('.quick-main').hide();
                    $('.online-main').show();
                    $('.weixin-main').hide();
                    $(".pay-tipcon2").hide();
                    $(".pay-tipcon").show();
                });
                //微信支付切换面板
                $('.weixin-tit').click(function () {

                    $(this).addClass('pay-cur');
                    $(this).siblings().removeClass('pay-cur');
                    $('.quick-main').hide();
                    $('.online-main').hide();
                    $('.weixin-main').show();
                    $('.zhifubao-main').hide();
                    $(".pay-tipcon2").hide();
                    $(".pay-tipcon").show();
                });
                //支付宝支付切换面板
                $('.zhifubao-tit').click(function () {

                    $(this).addClass('pay-cur');
                    $(this).siblings().removeClass('pay-cur');
                    $('.quick-main').hide();
                    $('.online-main').hide();
                    $('.weixin-main').hide();
                    $('.zhifubao-main').show();
                    $(".pay-tipcon2").hide();
                    $(".pay-tipcon").show();
                })
            });

            //防触蒙版
            function showSpan(op) {
                var thi = $("#thi").val().trim();
                if (thi == 0) {
                    $("body").append("<div id='mask'></div>");
                    $("#mask").addClass("mask").css("display", "block");

                    $("#" + op).css("display", "block");
                }

            }

            function displaySpan(op) {
                $("#mask").css("display", "none");
                $("#" + op).css("display", "none");
            }
        </script>
        <script>
            //快捷支付金额输入框鉴定方法定义
            function checkRecharge() {
                var moneyRegex = "^(([1-9]+[0-9]*)|((([1-9]+[0-9]*)|0)\\.[0-9]{1,2}))$";
                var money = $("#recharge\\:actualMoney").val();
                var nullFlag = (money == "") || money <= 0;
                var numberFlag = isNaN(money);
                //如果输入为空
                if (nullFlag) {
                    var $span = "<em></em>请输入金额";
                    $("#actualMoneyErrorDiv").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('#actualMoneyErrorDiv').html('')", 3000);
                    return false;
                } else {
                    $("#actualMoneyErrorDiv").html("");
                }
                //如果输入的不是数字
                if (numberFlag) {
                    var $span = "<em></em>请输入数字</span>";
                    $("#actualMoneyErrorDiv").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('#actualMoneyErrorDiv').html('')", 3000);
                    return false;
                } else {
                    $("#actualMoneyErrorDiv").html("");
                }
                //输入金额是否合法
                var moneyPattern = new RegExp(moneyRegex);
                var legalFlag = moneyPattern.test(money);
                if (!legalFlag) {
                    var $span = "<em></em>金额必须大于0且为整数或小数，小数点后不超过2位</span>";
                    $("#actualMoneyErrorDiv").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('#actualMoneyErrorDiv').html('')", 3000);
                    return false;
                } else {
                    $("#actualMoneyErrorDiv").html("");
                }
                return true;
            }

            //快捷支付同意服务方法定义
            function validateAgree() {
                var $checkname = $("#bank-check").children("b").hasClass("selected");
                if (!($checkname)) {
                    return false;
                } else {
                    return true;
                }
            }

            //银行卡充值按钮点击事件
            function getShowPayVal() {
                var rechargeFlag = checkRecharge();
                var agreeFlag = validateAgree();
                flag = rechargeFlag && agreeFlag;  //当两个方法都为true时为true，一个方法不为false时就为false。
                $("#recharge\\:rechargeWay").val($("#showpay").html());
                return flag;
            }

            //网银充值输入框
            function amount(th) {
                var regStrs = [
                    ['^0(\\d+)$', '$1'], //禁止录入整数部分两位以上，但首位为0
                    ['[^\\d\\.]+$', ''], //禁止录入任何非数字和点
                    ['\\.(\\d?)\\.+', '.$1'], //禁止录入两个以上的点
                    ['^(\\d+\\.\\d{2}).+', '$1'] //禁止录入小数点后两位以上
                ];
                for (i = 0; i < regStrs.length; i++) {
                    var reg = new RegExp(regStrs[i][0]);
                    th.value = th.value.replace(reg, regStrs[i][1]);
                }
                if (th.value > 9999999.99) {
                    th.value = th.value.substr(0, th.value.length - 1);
                }
            }

            //验证输入银行卡号的合法性
            function checkBankCardNo() {
                //$("#form\\:defaultBankName").text("");
                var cardNo = $("#form\\:bankCardNo").val();
                var reg = /^\d{16,19}$/g; // 以19位数字开头，以19位数字结尾
                if (!reg.test(cardNo)) {
                    //$(".info2-bank").css({"display":"none"});
                    var $span = "<em></em>银行卡号输入错误";
                    $("#bankCardError").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('#bankCardError').html('')", 3000);
                    return false;
                } else {
                    //$(".info2-bank").css({"display":"block"});
                    $("#bankCardError").html("");
                }
                return true;
            }

            function checkBank() {
                $("#form\\:defaultBankName").text("");
                var cardNo = $("#form\\:bankCardNo").val();
                var reg = /^\d{16,19}$/g; // 以19位数字开头，以19位数字结尾
                if (!reg.test(cardNo)) {
                    $(".info2-bank").css({"display": "none"});
                    return false;
                } else {
                    $(".info2-bank").css({"display": "block"});
                }
                return true;
            }

            //快捷支付选中协议方法定义
            function validateAgree2() {
                var $checkname = $("#bank-check2").children("b").hasClass("selected");
                if (!($checkname)) {
                    return false;
                } else {
                    return true;
                }
            }

            //快捷支付金额输入框鉴定方法定义
            function checkRecharge1() {
                var moneyRegex = "^(([1-9]+[0-9]*)|((([1-9]+[0-9]*)|0)\\.[0-9]{1,2}))$";
                var money = $("#form\\:actualMoney1").val();
                var nullFlag = (money == "") || money <= 0;
                var numberFlag = isNaN(money);
                //如果输入为空
                if (nullFlag) {
                    var $span = "<em></em>请输入充值金额";
                    $(".quick-error").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('.quick-error').html('')", 3000);
                    return false;
                } else {
                    $(".quick-error").html("");
                }
                //如果输入的不是数字
                if (numberFlag) {
                    var $span = "<em></em>请输入数字";
                    $(".quick-error").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('.quick-error').html('')", 3000);
                    return false;
                } else {
                    $(".quick-error").html("");
                }
                //输入金额是否合法
                var moneyPattern = new RegExp(moneyRegex);
                var legalFlag = moneyPattern.test(money);
                if (!legalFlag) {
                    var $span = "<em></em>金额必须大于0且为整数或小数，小数点后不超过2位";
                    $(".quick-error").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('.quick-error').html('')", 3000);
                    return false;
                } else {
                    $(".quick-error").html("");
                }

                if (parseInt(money) > 50000) {
                    var $span = "<em></em>充值金额超过50000元";
                    $(".quick-error").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('.quick-error').html('')", 3000);
                    return false;
                } else {
                    $(".quick-error").html("");
                }
                return true;
            }

            //快捷支付充值按钮点击事件
            function getShowPayVal1() {
                var rechargeFlag = checkRecharge1();
                var bankCardFlag = checkBankCardNo();
                var agreeFlag = validateAgree2();
                var payflag = rechargeFlag && bankCardFlag && agreeFlag;
                var defaultBankName = $("#form\\:defaultBankName").text();
                if (defaultBankName.replace(/(^\s*)|(\s*$)/g, "") == "此银行暂不支持") {
                    var $span = "<em></em>此银行暂不支持";
                    $(".quick-error3").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('.quick-error3').html('')", 3000);
                    return false;
                }
                $("#recharge\\:rechargeWay").val($("#showpay").html());
                return payflag;
            }

            function displaySpan(op) {
                $("#alert-ClickDialog").hide();
                $("#maskCommon").hide();
            }

            $(document).ready(function () {
                if ("false" == 'true') {
                    showSpan("alert-ClickDialog");
                }
                if ("false" == 'true') {
                    showSpan("alert-unbindMsgDialog");
                }
            });
            //]]>
        </script>
        <div class="personal-main">
            <div class="personal-pay">
                <h3><i>充值</i></h3>
                <div class="quick-pay-wrap">
                    <h4>
                        <span class="quick-tit pay-cur"><em>快捷支付</em></span>
                        <span class="online-tit"><em>网银充值</em></span>
                        <span class="weixin-tit"><em>微信支付</em></span>
                        <span class="zhifubao-tit"><em>支付宝支付</em></span>
                    </h4>
                    <form action="" id="form" method="post" name="form" onsubmit="return submitForm();">
                        <div class="quick-main">
                            <div class="fl quick-info">
                                <div class="info-1">
                                    <span class="info-tit">充值金额</span>
                                    <span class="info1-input">
                                        <input class="pay-money-txt ac" id="form:actualMoney1" maxlength="10" name="" type="text">
                                        <em>元</em>
                                    </span>
                                    <span class="quick-error"> </span>
                                </div>
                                <div class="info-tips">亿人宝提醒您：充值金额超过50000元时，请切换到网银充值</div>
                                <div class="info-2">
                                    <span class="info-tit">银行卡号</span>
                                    <span class="info2-input">
                                        <input class="tx-txt yh" id="form:bankCardNo" name="form:bankCardNo" type="text">
                                        <em class="info2-bank" style="display: none;">
                                        <label id="form:defaultBankName" style="font-size:16px;"> </label>
                                        </em>
                                    </span>
                                    <span class="quick-error3" id="bankCardError"></span>
                                </div>
                                <div class="bank-check" id="bank-check2">
                                    <b class="selected" id="bankProtocol2"></b>
                                    <span class="bank-agree">
                                        我同意并接受
                                        <a href="#" target="_blank">《亿人宝投资咨询与管理服务电子协议》</a>
                                    </span>
                                    <span class="error2" id="bankProtocol_message2" style="display:none;margin-top:-3px;">请同意协议内容！</span>
                                </div>
                                <input class="btn-paycz" type="submit" value="充值">
                            </div>
                            <div class="fr bank-info">
                                <p class="bank-tit">快捷支付支持银行：</p>
                                <img th:src="@{/images/logo_abc.png}">
                                <img style="border: 1px solid #D0D0D0;margin-top: 5px;" th:src="@{/images/logo_icbc.jpg}">
                                <div class="bank-pic"></div>
                            </div>
                        </div>
                    </form>
                    <div class="online-main" style="display:none;">
                        <form action="#" id="recharge" method="post" name="recharge" onsubmit="return acm()" target="_blank">
                            <div class="online-mar">
                                <div class="quick-info quick-info-width">
                                    <div class="info-1">
                                        <span class="info-tit">充值金额</span>
                                        <span class="info1-input">
                                            <input class="pay-money-txt acs" id="recharge:actualMoney" maxlength="10" name="recharge:actualMoney"
                                                   onblur="checkRecharge()" onkeydown="amount(this);keyUpcheck()" onkeyup="amount(this);keyUpcheck()"
                                                   type="text">
                                            <em>元</em>
                                        </span>
                                        <span class="quick-error2" id="actualMoneyErrorDiv"> </span>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <span>
                                    <font style=" color:#848484;font-weight:bold; margin-left:80px; height:32px; line-height:32px; font-size:12px;">亿人宝提醒您：充值前，请核实您的可用支付额度！</font>
                                </span>
                            </div>
                            <div class="pay-bank" id="pay-bank">
                                <h6>请选择充值银行（点击可查看银行卡号）</h6>
                                <span id="showpay" style="display:none;">icbc</span>
                                <ul id="paysSpan" style="height:150px;" th:each="b:${ban}" th:if="${ban != null}">
                                    <li th:if="${b.bankname == '中国农业银行'}">
                                        <img th:attrappend="tips-text=${b.bankn}" th:class="${bStat.first} ? 'on'" th:src="@{/images/logo_abc.png}">
                                        <em></em>
                                        <i></i>
                                    </li>
                                    <li th:if="${b.bankname == '中国工商银行'}">
                                        <img th:attrappend="tips-text=${b.bankn}" th:class="${bStat.first} ? 'on'" th:src="@{/images/logo_icbc.jpg}">
                                        <em></em>
                                        <i></i>
                                    </li>
                                    <input class="btn-paycz" onclick="add()" style="margin-left: 190px;margin-top: 50px;background-color: green" type="button"
                                           value="添加银行">
                                </ul>
                                <ul style="height: 200px;" th:if="${ban == null}">
                                    <div style=" width:760px;height:240px;padding-top:20px; text-align:center;color:#d4d4d4; font-size:16px;">
                                        <img height="60" th:src="@{/images/nondata.png}" width="60">
                                        <br><br>
                                        您还没有添加银行卡
                                        <br/><br/>
                                        <input class="btn-paycz" onclick="add()" style="margin-left: 190px;background-color: green" type="button" value="添加银行">
                                    </div>
                                </ul>
                                <span class="pay-other" th:if="${ban != null}">
                                    <span class="paytxt">选择其他银行卡</span>
                                    <i class="paydown"></i>
                                </span>

                            </div>
                            <div class="pay-bankstate">
                                <span class="bankstate-head">
                                    <i class="fl">请关注您的充值金额是否超限：</i>
                                    <i class="fr" id="show-pay-hotLine">工商银行客服热线：95588</i>
                                </span>
                                <table>
                                    <tbody>
                                    <tr>
                                        <td>单笔限额（元）</td>
                                        <td>每日限额（元）</td>
                                        <td>需要满足条件</td>
                                        <td>备注</td>
                                    </tr>
                                    <tr>
                                        <td width="15%">5000</td>
                                        <td width="15%">5000</td>
                                        <td width="20%">工银e支付</td>
                                        <td rowspan="5" width="50%">请到中国工商银行各营业网点办理成为个人网上银行客户并开通网上支付功能（静态密码用户进行网上支付如超过累计金额请直接到营业网点申领电子口令卡或USB Key）；</td>
                                    </tr>
                                    <tr>
                                        <td>500</td>
                                        <td>1000</td>
                                        <td>电子口令卡</td>
                                    </tr>
                                    <tr>
                                        <td>2000</td>
                                        <td>5000</td>
                                        <td>短信认证</td>
                                    </tr>
                                    <tr>
                                        <td>50万</td>
                                        <td>100万</td>
                                        <td>电子密码</td>
                                    </tr>
                                    <tr>
                                        <td>100万</td>
                                        <td>100万</td>
                                        <td>U盾</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="bank-check" id="bank-check">
                                <b class="selected" id="bankProtocol"></b>
                                <span class="bank-agree">
                                    我同意并接受
                                    <a href="/node/Candyprivacypolicy/candyprivacypolicy_tzzxyglfwdzxy" target="_blank">《亿人宝金融投资咨询与管理服务电子协议》</a>
                                </span>
                                <span class="error" id="bankProtocol_message" style="display:none;margin-top:-3px;">请同意协议内容！</span>
                            </div>
                            <input class="btn-paycz" name="recharge:j_idt96" type="submit" value="充值">
                            <input id="javax.faces.ViewState" name="javax.faces.ViewState" type="hidden">
                        </form>
                    </div>
                    <div class="weixin-main" style="display:none;">
                        <div class="online-mar">
                            <div class="quick-info quick-info-width">
                                <div class="info-1">
                                    <span class="info-tit">充值金额</span>
                                    <span class="info1-input">
                                        <input class="pay-money-txt acs" id="weixin-pay-money" maxlength="10" type="text">
                                        <em>元</em>
                                    </span>
                                    <span class="quick-error2" id="weixin-pay-tip"> </span>
                                </div>
                            </div>
                        </div>
                        <div>
                            <span>
                                <font style=" color:#848484;font-weight:bold; margin-left:80px; height:32px; line-height:32px; font-size:12px;">亿人宝提醒您：充值前，请核实您的可用支付额度！</font>
                            </span>
                        </div>

                        <input class="btn-paycz" id="weixin-pay-btn" type="button" value="充值">
                    </div>
                    <div class="zhifubao-main" style="display:none;">
                        <div class="online-mar">
                            <div class="quick-info quick-info-width">
                                <div class="info-1">
                                    <span class="info-tit">充值金额</span>
                                    <span class="info1-input">
                                        <input class="pay-money-txt acs" id="zhifubao-pay-money" maxlength="10" type="text">
                                        <em>元</em>
                                    </span>
                                    <span class="quick-error2" id="zhifubao-pay-tip"> </span>
                                </div>
                            </div>
                        </div>
                        <div>
                            <span>
                                <font style=" color:#848484;font-weight:bold; margin-left:80px; height:32px; line-height:32px; font-size:12px;">亿人宝提醒您：充值前，请核实您的可用支付额度！</font>
                            </span>
                        </div>

                        <input class="btn-paycz" id="zhifubao-pay-btn" type="button" value="充值">
                    </div>
                    <div class="pay-tipcon" style="display:none;"><b>充值提示：</b><br>
                        1．亿人宝充值过程免费，不向用户收取任何手续费。<br>
                        2．为了您的账户安全，请在充值前进行身份认证、手机绑定以及交易密码设置。<br>
                        3．您的账户资金将通过丰付支付第三方平台进行充值。<br>
                        4．请注意您的银行卡充值限制，以免造成不便。<br>
                        5．如果充值金额没有及时到账，请联系客服—400-999-8850
                    </div>
                    <div class="pay-tipcon2"><b>温馨提示：</b><br>
                        1. 投资人充值过程全程免费，不收取任何手续费。<br>
                        2. 为防止套现，所充资金必须经投标回款后才能提现。<br>
                        3. 使用快捷支付进行充值，可能会受到不同银行的限制，如需大额充值请使用网银充值进行操作。<br>
                        4. 充值/提现必须为银行借记卡，不支持存折、信用卡充值。<br>
                        5. 严禁利用充值功能进行信用卡套现、转账、洗钱等行为，一经发现，将封停账号30天。<br>
                        6. 充值期间，请勿关闭浏览器，待充值成功并返回首页后，所充资金才能入账，如有疑问，请联系客服。<br>
                        7. 充值需开通银行卡网上支付功能，如有疑问请咨询开户行客服。<br>
                    </div>
                </div>
            </div>


            <div class="alert-450 alert-h220" id="alert-rechargeFailture" style="display:none;">
                <div class="alert-title">
                    <h3>登录网上银行充值</h3>
                    <span class="alert-close" onclick="displaySpan('alert-rechargeFailture')"></span>
                </div>
                <div class="alert-main">
                    <form id="rechargeFailtureForm">
                        <p class="msg1">
                            <i class="no-icon"></i>
                            <i class="msgtxt">充值失败</i>
                            您可以：
                            <a href="/user/recharge">
                                <font color="#28A7E1">选择其他银行充值</font>
                            </a>
                            或查看
                            <a href="/term/Commonproblem?CategoryTermId=guanyutixian">
                                <font color="#28A7E1">充值帮助</font>
                            </a>
                        </p>
                    </form>
                </div>
            </div>

            <div class="clear"></div>

            <input id="thi" th:value="${thi}" type="hidden"/>
            <div class="alert-450 alert-h220" id="alert-notOpenAccount" style="display: block;" th:if="${thi == 0}">
                <div class="alert-title"><h3>提示</h3></div>
                <div class="alert-main">
                    <form id="notOpenAccountForm">
                        <p align="center" class="msg6">
                            用户在充值或提现前，需开通第三方账户。<br>
                            此页面将在5秒后自动跳转到开通第三方账户页面<br>
                            <em id="show-number">5</em>
                        </p>
                        <a class="btn-ok txt-center" id="openAccountAId" th:href="@{/per/thirdparty}">马上开通第三方账户</a>
                    </form>
                </div>
            </div>

            <div class="alert-400 alert-h220" id="alert-ClickDialog" style="display:none;">
                <div class="alert-title"><h3>消息</h3></div>
                <div class="alert-main">
                    <p class="msg4">

                    </p>
                    <p class="msg-a"><a class="btn-ok btn-145" href="#" onclick="displaySpan('alert-ClickDialog')">关 闭</a></p>
                </div>
            </div>
            <div class="alert-400 alert-h220" id="alert-unbindMsgDialog" style="display:none;">
                <div class="alert-title"><h3>消息</h3></div>
                <div class="alert-main">
                    <p class="msg4">

                    </p>
                    <p class="msg-a"><a class="btn-ok btn-145" href="#" onclick="displaySpan('alert-unbindMsgDialog')">关 闭</a></p>
                </div>
            </div>

            <script type="text/javascript">
                $(function () {
                    var rechargeResult = "";
                    if (rechargeResult == 'false') {
                        showSpan('alert-rechargeFailture');
                    }
                })
            </script>

            <script type="text/javascript">
                $("#recharge\\:actualMoney").val("单笔大于0元");
                var value = "单笔大于0元";
                $("#recharge\\:actualMoney").focus(
                    function () {
                        $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial", "border": "1px solid #0caffe"});
                        if ($("#recharge\\:actualMoney").val() == value) {
                            $("#recharge\\:actualMoney").val("");
                            $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial"});
                        }
                    }).blur(
                    function () {
                        $(this).css("border", "1px solid #D0D0D0");
                        if ($("#recharge\\:actualMoney").val() == "") {
                            $("#recharge\\:actualMoney").val("单笔大于0元").css("color", "#D0D0D0");
                            $(this).css({"color": "#D0D0D0", "font-size": "14px", "font-weight": "normal"});
                        }
                    });

                $("#form\\:actualMoney1").val("单笔大于0元");
                $("#form\\:actualMoney1").focus(
                    function () {
                        $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial", "border": "1px solid #0caffe", "height": "38px"});
                        if ($("#form\\:actualMoney1").val() == value) {
                            $("#form\\:actualMoney1").val("");
                            $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial", "height": "38px"});
                        }
                    }).blur(
                    function () {
                        $(this).css("border", "1px solid #D0D0D0");
                        if ($("#form\\:actualMoney1").val() == "") {
                            $("#form\\:actualMoney1").val("单笔大于0元").css("color", "#D0D0D0");
                            $(this).css({"color": "#D0D0D0", "font-size": "14px", "font-weight": "normal", "height": "38px"});
                        }
                    });

                $("#form2\\:actualMoney2").val("单笔大于0元");
                $("#form2\\:actualMoney2").focus(
                    function () {
                        $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial", "border": "1px solid #0caffe", "height": "38px"});
                        if ($("#form2\\:actualMoney2").val() == value) {
                            $("#form2\\:actualMoney2").val("");
                            $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial", "height": "38px"});
                        }
                    }).blur(
                    function () {
                        $(this).css("border", "1px solid #D0D0D0");
                        if ($("#form2\\:actualMoney2").val() == "") {
                            $("#form2\\:actualMoney2").val("单笔大于0元").css("color", "#D0D0D0");
                            $(this).css({"color": "#D0D0D0", "font-size": "14px", "font-weight": "normal", "height": "38px"});
                        }
                    });

                function keyUpcheck() {
                    $(this).css({"font-size": "24px", "font-weight": "bold", "font-family": "Arial"});
                }

                $("#form\\:bankCardNo").val("请输入银行卡号");
                var cardValue = "请输入银行卡号";
                $("#form\\:bankCardNo").focus(
                    function () {
                        $(this).css({
                            "font-size": "14px",
                            "font-weight": "bold",
                            "font-family": "Arial",
                            "border": "1px solid #0caffe",
                            "color": "rgb(75, 73, 72)"
                        });
                        if ($("#form\\:bankCardNo").val() == cardValue) {
                            $("#form\\:bankCardNo").val("");
                            $(this).css({"font-size": "14px", "font-weight": "bold", "font-family": "Arial"});
                        }
                    }).blur(
                    function () {
                        $(this).css("border", "1px solid #D0D0D0");
                        if ($("#form\\:bankCardNo").val() == "") {
                            $("#form\\:bankCardNo").val("请输入银行卡号").css("color", "#D0D0D0");
                            $(this).css({"color": "#D0D0D0", "font-size": "14px", "font-weight": "normal"});
                        }
                    })
            </script>
            <script type="text/javascript">
                var url = "[[@{/per/thirdparty}]]";
                $("#openAccountAId").attr("href", url);
                showSpan('alert-notOpenAccount');
                countDown('show-number', 5, url);
            </script>
            <div class="alert-450" id="alert-tyht" style="display:none;">
                <div class="alert-title"><h3>提示信息</h3><span class="alert-close" onclick="displaySpan('alert-tyht')"></span></div>
                <div class="alert-main" style="margin-bottom: 35px;margin-left: 25px;">
                    <p class="msg4">
                        你需要阅读并同意《亿人宝金融投资咨询与管理服务电子协议》
                    </p>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!--网站底部-->
<div class="ft" id="footer">
    <div th:replace="common/public::footer"></div>
</div>
<script type="text/javascript">
    //快捷支付充值
    function submitForm() {
        let b = getShowPayVal1();
        var actualMoney1 = $('.ac').val().trim();
        var bankCardNo = $('.yh').val().trim();
        let zzz = layer.load();
        $.ajax({
            url: 'https://ccdcapi.alipay.com/validateAndCacheCardInfo.json',
            type: 'post',
            async: false,
            data: {cardNo: bankCardNo, cardBinCheck: true},
            dataType: 'json',
            success: function (data) {
                layer.close(zzz);
                if (!data.validated) {  //银行卡格式错误的时候
                    var $span = "<em></em>银行卡号输入错误";
                    $("#bankCardError").html($span);
                    //设置3秒后清空内容！
                    setTimeout("$('#bankCardError').html('')", 3000);
                    b = false;
                }
            }
        });
        if (b) {
            layer.prompt({title: '请输入支付密码', formType: 1}, function (pass, index) {
                let zzz = layer.load();  //实例等待防触层
                $.ajax({
                    url: '/erb/per/payment',
                    type: 'post',
                    async: false,
                    data: {pwd: pass, amount: actualMoney1},
                    dataType: 'json',
                    success: function (data) {
                        layer.close(zzz);
                        if (data == 0) {
                            layer.msg('支付密码错误！', {
                                icon: 2
                            });
                        } else if (data == 1) {
                            layer.close(index);  //关闭弹出层
                            layer.msg('充值成功！', {time: 1000, icon: 1}, function () {
                                //刷新页面
                                location.reload()
                            });
                        }
                    }
                })
            });
        }
        return false;
    }

    $('#paysSpan li ').click(function () {
        let $this_siblings = $(this).siblings();
        $(this).children('i').remove();
        $this_siblings.children('i').remove();
        $this_siblings.children('img').removeClass('on');

        $(this).children('img').addClass('on');
        $(this).append('<i></i>');

        let tips_text = $('#paysSpan li .on').attr('tips-text');
        if (undefined != tips_text) {
            layer.tips(tips_text, '#paysSpan li .on');
        }
    });

    //银行卡充值
    function acm() {
        let c = getShowPayVal();
        var actualMoney1 = $('.acs').val().trim();  //金额
        var yh = $('#paysSpan li .on').attr('tips-text');
        if (yh == "" | yh == null) {
            layer.msg('请选择充值银行！', {
                icon: 5
            });
        } else if (c) {
            layer.prompt({title: '请输入支付密码', formType: 1}, function (pass, index) {
                let zzz = layer.load();  //实例等待防触层
                $.ajax({
                    url: '/erb/per/payment',
                    type: 'post',
                    async: false,
                    data: {pwd: pass, amount: actualMoney1},
                    dataType: 'json',
                    success: function (data) {
                        layer.close(zzz);  //关闭等待防触层
                        if (data == 0) {
                            layer.msg('支付密码错误！', {
                                icon: 5
                            });
                        } else if (data == 1) {
                            layer.close(index);  //关闭弹出层
                            layer.msg('充值成功！', {time: 1000, icon: 1}, function f() {
                                //刷新页面
                                location.reload()
                            });
                        }
                    }
                })
            });
        }
        return false;
    }

    //点击添加银行卡
    function add() {
        layer.prompt({title: '请输入银行卡号', formType: 0}, function (texts, index) {
            if (texts == "" | texts == null) {
                layer.msg('银行卡号不能为空！', {
                    icon: 5
                });
            } else {
                let zzz = layer.load();  //实例等待防触层
                $.ajax({
                    url: 'https://ccdcapi.alipay.com/validateAndCacheCardInfo.json',
                    type: 'post',
                    async: false,
                    data: {cardNo: texts, cardBinCheck: true},
                    dataType: 'json',
                    success: function (data) {
                        if (data.validated) {  //银行卡格式正确的时候
                            var yhname = "";
                            if (data.bank == 'ICBC') {
                                yhname = "中国工商银行";
                                $.ajax({
                                    url: '/erb/per/addbankcard',
                                    type: 'post',
                                    async: false,
                                    data: {bankn: texts, bankname: yhname},
                                    dataType: 'json',
                                    success: function (data) {
                                        layer.close(zzz);  //关闭等待防触层
                                        if (data) {
                                            layer.close(index);
                                            layer.msg('恭喜您！成功添加了一张银行卡！', {time: 1000, icon: 6}, function () {
                                                //刷新页面
                                                location.reload()
                                            });
                                        } else {
                                            layer.close(index);
                                            layer.msg('系统错误，请联系管理员！', {
                                                icon: 3
                                            });
                                        }
                                    }
                                })
                            } else if (data.bank == "ABC") {
                                yhname = "中国农业银行";
                                $.ajax({
                                    url: '/erb/per/addbankcard',
                                    type: 'post',
                                    async: false,
                                    data: {bankn: texts, bankname: yhname},
                                    dataType: 'json',
                                    success: function (data) {
                                        layer.close(zzz);  //关闭等待防触层
                                        if (data) {
                                            layer.close(index);
                                            layer.msg('恭喜您！成功添加了一张银行卡！', {time: 1000, icon: 6}, function () {
                                                //刷新页面
                                                location.reload()
                                            });
                                        } else {
                                            layer.close(index);
                                            layer.msg('系统错误，请联系管理员！', {icon: 3});
                                        }
                                    }
                                })
                            } else {
                                layer.close(zzz);  //关闭等待防触层
                                let i = layer.msg('此银行暂不支持！', {
                                    icon: 2
                                });
                            }
                        } else {
                            layer.close(zzz);  //关闭等待防触层
                            layer.msg('银行卡号输入错误！', {
                                icon: 5
                            });
                        }
                    }
                });
            }
        });
    }

    //点击微信支付
    $('#weixin-pay-btn').click(function () {
        let money = $('#weixin-pay-money').val().trim();
        //let reg = /^\d+$/;
        let reg = /^\d+(?=\.{0,1}\d+$|$)/;
        if (!reg.test(money)) {
            $('#weixin-pay-tip').html('<em></em>请输入正确的充值金额');
            setTimeout('$("#weixin-pay-tip").empty();', 2000);
            return;
        }
        if (money < 0.01) {
            $('#weixin-pay-tip').html('<em></em>充值金额不能少于0.01元');
            setTimeout('$("#weixin-pay-tip").empty();', 2000);
            return;
        }
        window.open('[[@{/pay?price=}]]' + money, '_blank');
    });

    //支付宝沙箱支付充值
    $("#zhifubao-pay-btn").click(function () {
        let money = $('#zhifubao-pay-money').val().trim();
        //let reg = /^\d+$/;
        let reg = /^\d+(?=\.{0,1}\d+$|$)/;
        if (!reg.test(money)) {
            $('#zhifubao-pay-tip').html('<em></em>请输入正确的充值金额');
            setTimeout('$("#zhifubao-pay-tip-pay-tip").empty();', 2000);
            return;
        }
        if (money < 0.01) {
            $('#zhifubao-pay-tip').html('<em></em>充值金额不能少于0.01元');
            setTimeout('$("#zhifubao-pay-tip-pay-tip").empty();', 2000);
            return;
        }
        location.href = '[[@{/per/pay?amount=}]]' + money;
    });

</script>
</body>
</html>
